<?php
    namespace app\api\controller\v1;

    use app\api\model\Poets as PoetsModel;
    use app\api\validate\AuthorDate;
    use app\api\validate\IDMustBePositiveInt;

    class Author 
    {
        public function getAuthor(){
                (new AuthorDate())->goCheck();
                $page = input('page',1);
                $limit = input('limit',10);
               $requset =  PoetsModel::getAuthors($page,$limit);
               return [
                   'code'=> 0,
                   'data'=> $requset
               ];
        }

        public function searchAuthor()
        {
            $name = input('name');
            $requset =  PoetsModel::searchAuthor($name);
            return [
                'code'=> 0,
                'data'=> $requset
            ];
        }

    }
    